package com.dlearn.spring.controller;

import com.dlearn.spring.modal.User;
import com.dlearn.spring.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2016/8/23.
 */

@RequestMapping("/user")
@Controller
public class UserController {
    @Resource
    private UserService userService;

    @RequestMapping("/test")
    public String getUserList() {
        List<User> list = userService.getUserList();
        for (User user : list) {
            System.out.print(user.getId());

        }
        return "index";
    }
}
